import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';
import { MoneyCollectTwotone } from '@vicons/antd';
import { renderIcon } from '@/utils/index';

const routeName = 'redpacket';

/**
 * @param name 路由名称, 必须设置,且不能重名
 * @param meta 路由元信息（路由附带扩展信息）
 * @param redirect 重定向地址, 访问这个路由时,自定进行重定向
 * @param meta.disabled 禁用整个菜单
 * @param meta.title 菜单名称
 * @param meta.icon 菜单图标
 * @param meta.keepAlive 缓存该路由
 * @param meta.sort 排序越小越排前
 * */
const routes: Array<RouteRecordRaw> = [
  {
    path: '/redpacket',
    name: routeName,
    redirect: '/redpacket/redpacketPlayer',
    component: Layout,
    meta: {
      title: '数据',
      icon: renderIcon(MoneyCollectTwotone),
      permissions: ['redpacket_redpacketPlayer', 'data_dailyBill','data_rankManage'],
      sort: 1,
    },
    children: [
      {
        path: 'redpacketPlayer',
        name: `${routeName}_redpacketPlayer`,
        meta: {
          title: '红包玩家',
          permissions: ['redpacket_redpacketPlayer'],
          keepAlive: false,
        },
        component: () => import('@/views/redpacket/redpacketPlayer/redpacketPlayer.vue'),
      },
      {
        path: 'redpacketConfiguration',
        name: `${routeName}_redpacketConfiguration`,
        meta: {
          title: '红包配置',
          keepAlive: false,
          permissions: ['redpacket_redpacketConfiguration'],
        },
        component: () => import('@/views/redpacket/redpacketConfiguration/redpacketConfiguration.vue'),
      },
      {
        path: 'anchorHbArrs',
        name: `${routeName}_anchorHbArrs`,
        meta: {
            title: '主播福利',
            keepAlive: false,
            permissions: ['redpacket_anchorHbArrs'],
        },
        component: () => import('@/views/redpacket/anchorhb/index.vue'),
    },
    ],
  },
];

export default routes;
